# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gir-to-d
pkgver=0.22.0
pkgrel=4
pkgdesc="Create D bindings from GObject introspection files"
url="https://github.com/gtkd-developers/gir-to-d"
# gdc is broken on 32bit arches
arch="aarch64 x86_64"
license="LGPL-3.0-or-later"
makedepends="meson ldc"
options="!check" # no tests
source="https://github.com/gtkd-developers/gir-to-d/archive/v$pkgver/gir-to-d-$pkgver.tar.gz
	segfault-fix.patch
	"

build() {
	# Instanciate all templates. Fixes:
	# undefined reference to `_D6object__T8opEqualsTxC3gtd11GirFunctionQnTxQwZQBkFxQBexQBiZb'
	export DFLAGS="--allinst"
	abuild-meson . output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
18a06884153c4ec7c028a2ad492bf272500e3e4079ae7c3eba6188f7681377edde2fe0cbcacedaa757aa6ed5bcf5f1ba2d201093d6f31111692a0162b44c77d6  gir-to-d-0.22.0.tar.gz
3eec12243f789b81dc0782aadc0deb9ce87dbd7934f35b630ac863e1b573b7e5736b0ad70856b515e7de4ab6f0a57735026ceedb1f5933494f42127037cd2d2f  segfault-fix.patch
"
